<template>
  <footer class="app-footer">
    <el-card class="footer-card">
      <div class="footer-container">
        <div class="footer-section">
          <h3>朝物夕拾</h3>
          <p>安全、便捷的校园二手交易平台</p>
        </div>
        
        <div class="footer-section">
          <h4>快速链接</h4>
          <ul>
            <li><a href="#" @click.prevent="navigateTo('/')">首页</a></li>
            <li><a href="#" @click.prevent="navigateTo('/create')">发布商品</a></li>
            <li><a href="#" @click.prevent="navigateTo('/profile')">个人中心</a></li>
          </ul>
        </div>
        
        <div class="footer-section">
          <h4>联系方式</h4>
          <p>邮箱：support@campusmarket.com</p>
          <p>微信公众号：校园二手市场</p>
        </div>
      </div>
      
        <div class="footer-bottom">
        <p>&copy; {{ new Date().getFullYear() }} 朝物夕拾. 保留所有权利.</p>
        <p>提醒：线下交易请注意人身和财产安全</p>
      </div>
    </el-card>
  </footer>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { ElCard } from 'element-plus'

const router = useRouter()

// 导航到指定路径
const navigateTo = (path: string) => {
  router.push(path)
}
</script>

<style scoped>
.app-footer {
  margin-top: 60px;
}

.footer-card {
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  padding: 40px 20px;
}

.footer-section h3 {
  color: #333;
  margin-bottom: 15px;
}

.footer-section h4 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.footer-section p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.footer-section ul li a:hover {
  color: #007bff;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #e9ecef;
  color: #666;
  font-size: 0.9em;
}

.footer-bottom p {
  margin: 5px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 20px;
  }
}
</style>